//
//  RBIntegralDetailCell.m
//  zhongzhenglu
//
//  Created by 马军凯 on 2023/5/4.
//

#import "RBIntegralDetailCell.h"
#import "RBIntegralDetailResponse.h"

@interface RBIntegralDetailCell ()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@property (weak, nonatomic) IBOutlet UILabel *timeLabel;

@property (weak, nonatomic) IBOutlet UILabel *integralLabel;

@end

@implementation RBIntegralDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

//赋值
- (void)setCellModel:(RBCellModel *)cellModel {
    RBIntegralDetailModel *model = cellModel.cellData;
    //标题
    NSString *title = @"其他方式";
    if ([model.type isEqualToString:@"1"]) {
        title = @"签到";
    } else if ([model.type isEqualToString:@"2"]) {
        title = @"抽奖";
    }
    self.titleLabel.text = title;
    //时间
    self.timeLabel.text = model.create_time;
    //积分
    NSString *symbol = @"";
    if ([model.addred isEqualToString:@"1"]) {
        symbol = @"+";
    } else if ([model.addred isEqualToString:@"2"]) {
        symbol = @"-";
    }
    self.integralLabel.text = [NSString stringWithFormat:@"%@%@", symbol, model.integral];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
